import {request} from '../request';

const requestUserPre = "/system/user";

export function selectListUser(data) {
	return request.post(
		requestUserPre + "/selectList",
		data
	);
}


export function saveOrUpdateUser(data, state) {
	if (state === 'add') {
		return saveUser(data);
	}
	return request.post(
		requestUserPre + "/update",
		data
	);
}

export function saveUser(data) {
	return request.post(
		requestUserPre + "/save",
		data
	);
}

export function deleteUser(userId) {
	return request.delete(
		requestUserPre + "/delete/" + userId,
	);
}

export function selectListRole(userId) {
	return request.delete(
		requestUserPre + "/selectListRole/" + userId,
	);
}

export function tenantList() {
	return request.get(
		  "/system/tenant/selectList",
		{
			headers:
				{skipToken: true,"tenantId":'1','Content-Type': ''}
		}
	);
}


